import { floatToFixed2 } from '@/utils'

// 格式化金额【分转元】
// @ts-ignore
export const fenToYuanFormat = (_, __, cellValue: any, ___) => {
  return `￥${floatToFixed2(cellValue)}`
}

export const priceFormat = (_, __, cellValue: any, ___) => {
  if (cellValue === null || cellValue === undefined || isNaN(Number(cellValue))) return '-'
  return `￥${Number(cellValue).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`
}
